<?php
/*
 * @Author: AriFe.Liu
 * @Date: 2020-09-21 14:35:28
 * @LastEditors: AriFe.Liu
 * @LastEditTime: 2020-09-21 14:47:12
 * @Description: 
 */

namespace addons\banner;

use app\common\library\Menu;
use think\Addons;

/**
 * 插件
 */
class Banner extends Addons
{

    /**
     * 插件安装方法
     * @return bool
     */
    public function install()
    {
        $menu = [
            [
                'name'    => 'banner',
                'title'   => '轮播图管理',
                'icon'    => 'fa fa-photo',
                'sublist' => [
                    ['name' => 'banner/index', 'title' => '查看'],
                    ['name' => 'banner/add', 'title' => '添加'],
                    ['name' => 'banner/detail', 'title' => '详情'],
                    ['name' => 'banner/del', 'title' => '删除'],
                    ['name' => 'banner/multi', 'title' => '批量更新'],
                ]
            ]
        ];
        Menu::create($menu);
        return true;
    }

    /**
     * 插件卸载方法
     * @return bool
     */
    public function uninstall()
    {
        Menu::delete('banner');
        return true;
    }

    /**
     * 插件启用方法
     * @return bool
     */
    public function enable()
    {
        Menu::enable('banner');
        return true;
    }

    /**
     * 插件禁用方法
     * @return bool
     */
    public function disable()
    {
        Menu::disable('banner');
        return true;
    }

}
